package handler;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.dbutils.ResultSetHandler;

import drh.bean.Image;

public class ImageResultSetHandler implements ResultSetHandler<List<Image>> {

	@Override
	public List<Image> handle(ResultSet rs) throws SQLException {
		List<Image>list = new ArrayList<>();
		while(rs.next()) {
			Image info = new Image();
			info.setId(rs.getInt("id"));
			info.setProductid(rs.getInt("productid"));
			info.setImgid(rs.getString("imgid"));
			info.setImgtype(rs.getInt("imgtype"));
			info.setTime(rs.getDate("time"));
			info.setIsdelete(rs.getInt("isdelete"));
			list.add(info);
		}
		return list;
	}
	

}
